package org.example.service;

import org.example.commonapi.domain.R;
import org.example.commonapi.domain.Player;
import org.example.commonapi.request.characterSimulation.AgentRequest;
import org.example.commonapi.response.aippt.ThemeInfo;
import org.example.commonapi.response.characterSimulation.CharacterSimulationListener;
import org.example.commonapi.request.characterSimulation.InteractiveRequest;
import org.example.commonapi.response.bigmodel.SparkChatListener;
import org.example.commonapi.response.fileUnderstand.FileUnderstandListener;
import org.example.commonapi.response.fileUnderstand.UploadResponse;
import org.example.commonapi.response.speechSynthesis.SpeechSynthesisListener;
import org.example.commonapi.vo.VideoVO;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;

public interface AiChatService {
    SparkChatListener chat(String question, StringBuilder answer,Long userId) throws Exception;

    SseEmitter getConn(long userId);

    R<String> draw(String question, Integer width, Integer height) throws Exception;

    R<String> judgePlayerReigster(String playerName) throws Exception;

    R<String> playerRegister(Player player,HttpServletRequest httpServletRequest) throws Exception;

    R<String> playerEdit(Player player) throws Exception;

    R<String> playerDelete(Player player) throws Exception;

    R<String> agentCreate(AgentRequest agentRequest) throws Exception;

    R<String> agentEdit(AgentRequest agentRequest) throws Exception;

    R<AgentRequest> getAgentInfo(String playerId) throws Exception;

    R<String> agentDelete(AgentRequest agentRequest) throws Exception;

    R<String> generateMemory(InteractiveRequest interactiveRequest) throws Exception;

    CharacterSimulationListener characterSimulationChat(String question, StringBuilder answerCache,String playerId,String agentId,String chatId,String preChatId) throws Exception;

    R<List<Player>> getPlayerInfoList(HttpServletRequest httpServletRequest);

    SparkChatListener imageUnderStandChat(String question, StringBuilder answerCache, String UID) throws Exception;

    R<String> getBase64Link(MultipartFile file) throws IOException;

    R<String> fileUnderStandUpload(MultipartFile file) throws IOException;

    FileUnderstandListener fileUnderStandChat(String question, StringBuilder answerCache, String fileId) throws Exception;

    R<List<ThemeInfo.Datas>> getAiPPTInfo() throws IOException;

    void getAiPPTWithoutAnything(String type,String author,String query,Boolean isCardNote,Boolean isCoverImg,String theme,SseEmitter emitter) throws IOException, InterruptedException;

    SpeechSynthesisListener aiSpeechSynthesis(String text, StringBuilder answer) throws Exception;

    R<String> getBase64LinkByUID(String uid);

    R clearChatHistory(HttpServletRequest request);
}
